package com.department.mydepartment.repository;

import com.department.mydepartment.entities.User;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

//继承JpaRepository(封装crud),JpaSpecificationExecutor(封装复杂查询)来完成对数据库的操作
public interface UserRepository extends JpaRepository<User,String>{

    /**
     *
     * @param userId
     * @return
     */
    User findByUserId(String userId);
    List<User> findAll();
    void deleteByUserId(String userId);
}
